<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<p></p>
		<script type="text/javascript">
			//第一个乘法表
			document.write("<table border='1'>");
			for(var i=1; i<10;i++){
				document.write("<tr>");
				for(var j =1; j<=i; j++){
					document.write( "<td>"+j +"X"+i + "="+i*j+"</td>")
				}
				for(var o=0;o<(9-i);o++){
					document.write("<td></td>")
				}
				document.write("</tr>");
			}
			document.write("</table>");
			//第二个乘法表
			document.write("<table border='1'>");
			for(var k = 9; k>0; k--){
				document.write("<tr>");
				for(var l =1; l<=k; l++){
					document.write( "<td>"+l +"X"+k + "="+k*l+"</td>")
				}
				for(var o=0;o<(9-k);o++){
					document.write("<td></td>")
				}
				document.write("</tr>");
			}
			document.write("</table>");
			//第三个乘法表
			document.write("<table border='1'>");
			for(var i=1; i<10;i++){
				document.write("<tr>");
				for(var o=0;o<(9-i);o++){
					document.write("<td></td>")
				}
				for(var j =i; j>0; j--){
					document.write( "<td>"+j +"X"+i + "="+i*j+"</td>")
				}
				document.write("</tr>");
			}
			document.write("</table>");
			//第四个乘法表
			document.write("<table border='1'>");
			for(var k = 1; k<10; k++){
				document.write("<tr>");
				for(var o=1;o<k;o++){ 
					document.write("<td></td>")
				}
		
				for(var l =k; l<10; l++){
					document.write( "<td>"+l +"X"+k + "="+k*l+"</td>")
					console.log("l",l);
				}
				document.write("</tr>");
				console.log("k",k);
			}
			document.write("</table>");
			//k=1 l=9
			//k=2 l=8
		</script>
	</body>
</html>
